// $Id: TypeFactory.java,v 1.41 2005/08/11 00:07:47 oneovthafew Exp $
package org.mk.type;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.mk.MySQLType;

/**
 * 没一个工厂都对应一个DB类型
 * and constants on <tt>org.hibernate.Hibernate</tt>.
 * 
 * @see org.mk.MySQLType
 * @author Gavin King
 */
public final class MySQLTypeFactory extends TypeFactory{

	private static final Map BASIC_TYPES;

	static {
		
		HashMap basics = new HashMap();
		//string
		TypeFactory.put(basics, MySQLType.STRING.getNames(), MySQLType.STRING );
		//integer
		TypeFactory.put(basics, MySQLType.INTEGER.getNames(), MySQLType.INTEGER );	
		
		TypeFactory.put(basics, MySQLType.FLOAT.getNames(), MySQLType.FLOAT );	
		
		
		TypeFactory.put(basics, MySQLType.DATE.getNames(), MySQLType.DATE );	
		TypeFactory.put(basics, MySQLType.TIMESTAMP.getNames(), MySQLType.TIMESTAMP );
		
		BASIC_TYPES = Collections.unmodifiableMap( basics );
	}

	private MySQLTypeFactory() {
		throw new UnsupportedOperationException();
	}



	/**
	 * Given the name of a Hibernate basic type, return an instance of
	 * <tt>org.hibernate.type.Type</tt>.
	 */
	public static Type basic(String name) {
		return (Type) BASIC_TYPES.get( name );
	}












	

}
